package org.istt.domain;

import static javax.persistence.GenerationType.IDENTITY;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;


/**
 * MenuTree entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name="TBL_MENUTREE"
    ,schema="dbo"
    ,catalog="onegate"
)

public class MenuTree extends BaseObject<Long> implements java.io.Serializable {


    /**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	// Fields    
     private Long id;
     private Menu menu;
     private Long childMenuId;

    // Constructors
    /** default constructor */
    public MenuTree() {
    }
    
    /** full constructor */
    public MenuTree(Menu fatherMenu, Long menuId) {
        this.menu = fatherMenu;
        this.childMenuId = menuId;
    }

   
    // Property accessors
    @Id @GeneratedValue(strategy=IDENTITY)
    
    @Column(name="ID", unique=true, nullable=false)

    public Long getId() {
        return this.id;
    }
    
    public void setId(Long id) {
        this.id = id;
    }
	@ManyToOne(fetch=FetchType.LAZY)
        @JoinColumn(name="FATHER_ID")
    public Menu getMenu() {
        return this.menu;
    }
    
    public void setMenu(Menu menu) {
        this.menu = menu;
    }
    
    @Column(name="MENU_ID")
    public Long getChildMenuId() {
        return this.childMenuId;
    }
    
    public void setChildMenuId(Long menuId) {
        this.childMenuId = menuId;
    }
    

	@Override
	public String toString() {
		
		return null;
	}

	@Override
	public boolean equals(Object o) {
		
		return false;
	}

	@Override
	public int hashCode() {
		
		return 0;
	}
}